<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:template match="/">
        <html>
            <head>
                <link href="/css/bootstrap.css" rel="stylesheet" media="screen"/>
                <link href="/css/bootstrap-responsive.css" rel="stylesheet" media="screen"/>
                <link href="/css/docs.css" rel="stylesheet" media="screen"/>
                <meta charset="UTF-8"/>
                <title>Подгруппы</title>
            </head>
            <body>
                <div style="margin-top: 20px">
                    <div class="container">
                        <div class="row">
                            <div class="span3 bs-docs-sidebar">
                                <ul class="nav nav-list affix bs-docs-sidenav">
                                    <li>
                                        <!--<i class="icon-chevron-right"/>-->
                                        <a href="/service/agents/and/queues">
                                            Агенты и очереди звонков
                                        </a>
                                    </li>
                                    <li class="active">
                                        <!--<i class="icon-chevron-right"/>-->
                                        <a href="/service/show/hunt/groups">
                                            Подгруппы
                                        </a>
                                    </li>
                                    <li>
                                        <a href="/service/show/call/hist">
                                            Распределение звонков
                                        </a>
                                    </li>
                                    <li class="dropdown-submenu">
                                        <a tabindex="-1" href="#">Статистика</a>
                                        <ul class="dropdown-menu">
                                            <li>
                                                <a href="/service/show/super/stats?units-count=12&amp;time-unit=hours">
                                                    12 часов
                                                </a>
                                            </li>
                                            <li>
                                                <a href="/service/show/super/stats?units-count=24&amp;time-unit=hours">
                                                    1 день
                                                </a>
                                            </li>
                                            <li>
                                                <a href="/service/show/super/stats?units-count=2&amp;time-unit=days">
                                                    2 дня
                                                </a>
                                            </li>
                                            <li>
                                                <a href="/service/show/super/stats?units-count=7&amp;time-unit=days">
                                                    1 неделя
                                                </a>
                                            </li>
                                            <li>
                                                <a href="/service/show/super/stats?units-count=30&amp;time-unit=days">
                                                    1 месяц
                                                </a>
                                            </li>
                                        </ul>
                                    </li>
                                    <li>
                                        <!--<i class="icon-chevron-right"/>-->
                                        <a href="/service/log/out">
                                            Выход
                                        </a>
                                    </li>
                                </ul>
                            </div>
                            <div class="span9">
                                <div class="page-header">
                                    <h1>Подгруппы</h1>
                                </div>

                                <form>
                                    <table class="table table-bordered table-striped">
                                        <thead>
                                            <tr>
                                                <th>Подгруппа</th>
                                                <th>Статус</th>
                                                <th>Номер</th>
                                                <th>Выбрать</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <xsl:for-each select="/response/hunt-groups/hunt-group">
                                                <xsl:apply-templates select="."/>
                                            </xsl:for-each>
                                        </tbody>
                                    </table>

                                    <div style="float:right;position:relative">
                                        <input style="margin-right: 5px" type="submit" value="Вход" formaction="/service/add/user"/>
                                        <input type="submit" value="Выход" formaction="/service/remove/user"/>
                                    </div>

                                </form>

                            </div>
                        </div>
                    </div>
                </div>

            </body>
        </html>
    </xsl:template>

    <xsl:template match="/response/hunt-groups/hunt-group">
        <xsl:variable name="group-name" select="./@name"/>
        <tr>
            <td><xsl:value-of select="./@name"/></td>
            <td><xsl:value-of select="./@status"/></td>
            <td><xsl:value-of select="./@extension"/></td>
            <td>
                <input type="checkbox">
                    <xsl:attribute name="name"><xsl:value-of select="$group-name"/></xsl:attribute>
                </input>
            </td>
        </tr>
    </xsl:template>

</xsl:stylesheet>
